import actionType from "./actionType";

const initState = {
  requestParams: {
    deptID: "",
    devName: "",
    devLocation: ""
  },
  devTableList: []
};

const devReducers = (state = initState, action: any) => {
  switch (action.type) {
    case actionType.SET_PARAMS:
      return {
        ...state,
        requestParams: {
          ...state.requestParams,
          ...action.payload
        }
      };

    case actionType.GET_DEV_TABLE:
      return {
        ...state,
        devTableList: action.payload
      };

    default:
      return state;
  }
};
export default devReducers;
